package de.uv.kilter.core.implementation;

import java.util.List;

import de.uv.kilter.core.IConnection;
import de.uv.kilter.core.INode;

public class Helper {

	/**
	 * This method prints all given paths.
	 * 
	 * @param allConnections - paths to be printed
	 */
	public static void printAllConnections(List<List<IConnection>> allConnections) {
		int i = 1;
		if (allConnections != null) {
			for (List<IConnection> connections: allConnections) {
				System.out.println("Connection " + i++);
				if (connections != null) {
					for (IConnection connection: connections)
						System.out.println(connection.getSourceNode().getName() + " -----> " + connection.getTargetNode().getName());
				}
			}
		}
	}
	
	/**
	 * This method prints all given connections and their attributes.
	 * 
	 * @param allConnections - connections to be printed
	 */
	public static void printConnections(List<IConnection> connections) {
		if (connections != null) {
			for (IConnection connection: connections)
				System.out.println(connection);
		}
	}
	
	/**
	 * This method prints all given nodes and their attributes.
	 * 
	 * @param allConnections - nodes to be printed
	 */
	public static void printNodes(List<INode> nodes) {
		if (nodes != null) {
			for (INode node : nodes)
				System.out.println(node);
		}
	}
}
